import requests

headers = {
    'Accept': 'application/json, text/plain, */*',
    'Accept-Encoding': 'gzip, deflate, br',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'Cache-Control': 'no-cache',
    'Connection': 'keep-alive',
    'Content-Length': '86',
    'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
    'Host': 'static.sdjzu.edu.cn',
    'Origin': 'https://static.sdjzu.edu.cn',
    'Pragma': 'no-cache',
    'Referer': 'https://static.sdjzu.edu.cn',
    'sec-ch-ua': '"Not A;Brand";v="99", "Chromium";v="102", "Google Chrome";v="102"',
    'sec-ch-ua-mobile': '?0',
    'Cookie': 's_pers=%20v8%3D1662772748602%7C1757380748602%3B%20v8_s%3DFirst%2520Visit%7C1662774548602%3B%20c19%3Dsd%253Ahome%253Ahpx%7C1662774548606%3B%20v68%3D1662772747741%7C1662774548610%3B; AMCV_4D6368F454EC41940A4C98A6%40AdobeOrg=-2121179033%7CMCIDTS%7C19246%7CMCMID%7C34669042746842785414051749298845393975%7CMCAAMLH-1663377548%7C11%7CMCAAMB-1663377548%7CRKhpRz8krg2tLO6pguXWp5olkAcUniQYPHaMWWgdJ3xzPWQmdj0y%7CMCOPTOUT-1662779948s%7CNONE%7CMCAID%7CNONE%7CMCCIDH%7C-1925407550%7CvVersion%7C5.3.0; CTTICKET=app_H5_2ba98b4edcdd3f5649e33ba0dc507458f69065f0_webreq; APPCTTICKET=app_H5_2ba98b4edcdd3f5649e33ba0dc507458f69065f0',
    'sec-ch-ua-platform': '"Windows"',
    'Sec-Fetch-Dest': 'empty',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Site': 'same-origin',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36',
}


# #
# base_url = 'https://static.sdjzu.edu.cn/h5/#/pages/user/login?url=%252Fpages%252Fapplication%252Furgent-report%252Ftemperature-measurement-report'
def get_token(url):
    date = {
        'clientOSType': 'H5 - windows',
        'deviceModel': 'PC',
        'clientVerNum': '102',
        'source': '157',
        'userid': '202111110121',
        'password': 'yT1615767372',
        'UUID': 'e331abbd-3ff3-4bd3-a283-3835a2b208e4',
        'osType': 'H5',
        'wxcode': '',
        'captcha': '',
    }
    response = requests.post(url=url, data=date, headers=headers)
    content = response
    print(content.text)


def get_schem():
    data2 = {
        'clientOSType': 'H5-windows',
        'deviceModel': 'PC',
        'clientVerNum': '102',
        'source': '157',
        'timestamp': '1663491976535',
        'temperatureMorning': 'A',
        'physicalConditionMorning': 'A',
        'temperatureNoon': 'A',
        'physicalConditionNoon': 'A',
        'temperatureEvening': 'A',
        'physicalConditionEvening': 'A',
        'address': '',
        'location': '',
        'passiveUserId': '202111110121',
        'captcha': '5ccce26677c10b0c7757ab6d0cbb816e'
    }
    base_url = 'https://static.sdjzu.edu.cn/report/api/addOnCampusThermometryLog'
    response = requests.post(url=base_url, data=data2, headers=headers)
    content = response.text
    print(content)


if __name__ == '__main__':
    get_schem()
